<?php

namespace App\Dmeo;

use App\Models\LoginHome;
use Illuminate\Support\Facades\DB;

class DayLogin
{

    public static function AuthLoginHome(string $name,string $password){
        try {
           $tableName=  DB::table("new_admin")
                ->where("name",$name)
                ->select("name")
                ->first();

            if (empty($tableName)){
               throw new \Exception("用户名有错误");
            }

           return  LoginHome::LoginModel($password);

//            if (password_verify($password,$password){
//            //哈希解密
//                 exit("500");
//            }
        }catch (\Exception $e)
        {
            return  ['code'=>520,'msg'=>"用户名有错误",'data'=>""];

        }

    }

}
